namespace GemBox.Spreadsheet
{
    using System;
    using System.IO;

    internal class SheetIndexes : BinaryWritable
    {
        private ushort sheetIndex;

        public SheetIndexes(BinaryReader br)
        {
            br.ReadUInt16();
            this.sheetIndex = br.ReadUInt16();
            br.ReadUInt16();
        }

        public SheetIndexes(ushort sheetIndex)
        {
            this.sheetIndex = sheetIndex;
        }

        public override void Write(BinaryWriter bw)
        {
            bw.Write((ushort) 0);
            bw.Write(this.SheetIndex);
            bw.Write(this.SheetIndex);
        }

        public ushort SheetIndex
        {
            get
            {
                return this.sheetIndex;
            }
            set
            {
                this.sheetIndex = value;
            }
        }

        public override int Size
        {
            get
            {
                return 6;
            }
        }
    }
}
